<template>
  <div class="dashboard-container">
    <el-row :gutter="20">
      <el-col :span="12">
        <el-card>
          <mycalendar></mycalendar>
        </el-card>
      </el-col>
      <el-col :span="12">
        <el-card>
          审批
          <el-button @click="changeLang">{{$t('dashboard.changeLang')}}</el-button>
        </el-card>
      </el-col>
    </el-row>
  </div>
</template>

<script>
// import { mapGetters } from 'vuex'
import Cookie from 'js-cookie'

export default {
  name: 'Dashboard',
  components: {
    mycalendar: () => import('./calendar/index.vue')
  },
  methods: {
    
    changeLang() {
     Cookie.set('lang', this.$i18n.locale === 'en' ? 'zh' : 'en')
      // 更新 element 中的语言
      window.location.reload()
    }
  },
  async created () {
    await this.$nextTick()
    // console.clear()
  }
}
</script>

<style lang="scss" scoped>
.dashboard-container {
  margin: 20px;

}
</style>
